import Vue from 'vue'
import VueRouter from 'vue-router'

import Index from '@/views/index.vue'
import Class from '@/views/class.vue'
import Order from '@/views/order.vue'
import Mine from '@/views/mine.vue'
import Sport from '@/views/sport.vue'
import SportIn from '@/views/SportIn.vue'
import SportOut from '@/views/SportOut.vue'
Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/index' },
  { path: '/index', component: Index },
  { path: '/class', component: Class },
  { path: '/order', component: Order },
  { path: '/mine', component: Mine },
  {
    path: '/sport',
    component: Sport,
    children: [
      {
        path: '/sportin',
        component: SportIn
      },
      {
        path: '/sportout',
        component: SportOut
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router